<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 1、数学运算符 （+ - * / %）
    var num1 = 10
    var num2 = 3
    console.log(num1 % num2);
    // console.log(5 / 0);

    // 2、赋值运算符
    var a = 1
    var b = 2
    // b = b + 1
    b += 1
    // b += 1
    console.log(b);

    // 3、自增自减
    var c = 1
    // c++
    console.log(c++);//1   2
    console.log(c);

    // 4、比较运算符 (true false)
    var d = 5
    var e = '5'
    console.log(d == e); // 
    console.log(d === e); //

    console.log(3 != '4');


    // 5、逻辑运算符
    console.clear()

    var f = 1
    var g = 1
    var h = 3
    // 与：两侧都是true
    // if (f == g && g == h) {
    //   console.log('true');
    // }
    // 或：两侧有一个是true
    if (f == g || g == h) {
      console.log('true');
    }

    // 非
    if (!true) {
      console.log('成功了');
    }

    // 6、数据类型检测
    console.log(typeof 3);//number
    console.log(typeof '3');//string
    console.log(typeof true);//boolean
    console.log(typeof undefined);//undefined

    console.log(typeof null);//object


    console.log(typeof {});//object
    console.log(typeof { name: 'xxx' });//object
    console.log(typeof console);//object

    if (typeof h == 'number') {
      console.log('h是数字类型');
    }

    console.log(a);
    console.log(e);


    // 12345rtfdsw


  </script>
</body>

</html>